package com.huawei.hwid.core.encrypt;

import android.text.TextUtils;
import com.huawei.hwid.core.d.b.e;
import com.huawei.secure.android.common.encrypt.hash.HMACSHA256;
import java.io.UnsupportedEncodingException;

public class b {
    public static String a(String str, String str2) {
        if (!(TextUtils.isEmpty(str2) || TextUtils.isEmpty(str))) {
            try {
                return HMACSHA256.hmacSHA256Encrypt(str, str2.getBytes("UTF-8"));
            } catch (UnsupportedEncodingException e) {
                e.d("HwIDHMACSHA256", "UnsupportedEncodingException", true);
            }
        }
        return "";
    }
}
